home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / smail-3.1.28 / samples / arcnet / send.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1990-10-23  |  1.3 KB  |  38 lines

  1. : /bin/sh
  2. # @(#)samples/arcnet/send.sh    1.2 10/24/90 05:19:47
  3. #
  4. # Send mail to a remote host that is visible under the /net filesystem
  5. # and that is not secure.
  6. #
  7. # Each site listed under the /net filesystem should have a message
  8. # directory /usr/spool/smail/forpro/<remote-site> and a status
  9. # directory /usr/spool/smail/forpro/<remote-site>/done, where there
  10. # must be a <remote-site> and <remote-site>/done directory for each
  11. # site that can talk to that host, thus, for a network consisting of
  12. # the machines herman, frank and joe, the site herman must have the
  13. # directories frank, joe, frank/done and joe/done.
  14. #
  15. # To transmit a message, first the message itself (which should be in
  16. # batched SMTP format) is copied to the directory
  17. # /net/<remote-site>/usr/spool/smail/forpro/<local-site>, then a file
  18. # is created in the <local-site>/done directory to signal that the
  19. # copy is completed.  For both of these files, the basename is the
  20. # message id with the initial letter removed.
  21. #
  22. # On invocation, argument one is expected to be the host that we are
  23. # sending to and 
  24.  
  25. set -e
  26.  
  27. HOSTNAME="$1"
  28. MSGID="`echo "$2" | sed 's/.//'`"
  29. HOST_MAIL_DIR="/net/$HOSTNAME/usr/spool/smail/forpro/`cat /etc/sitename`"
  30.  
  31. # write the mail message
  32. cat > "$HOST_MAIL_DIR/$MSGID"
  33.  
  34. # signal that we have finished writing the message
  35. touch "$HOST_MAIL_DIR/done/$MSGID"
  36.  
  37. exit 0
  38.